home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / hf^k-6.dms / in.adf / Install.run / GOLDEDDATA / arexx / number.ged < prev    next >
Encoding:
Text File  |  1996-11-10  |  1.9 KB  |  84 lines

  1. /* $VER: 1.0, ©1996 Dietmar Eilert. Number lines. */
  2.  
  3. OPTIONS RESULTS                             /* enable return codes     */
  4.  
  5. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  6.     address 'GOLDED.1'
  7.  
  8. 'LOCK CURRENT RELEASE=4'                    /* lock GUI, gain access   */
  9.  
  10. if (RC ~= 0) then
  11.     exit
  12.  
  13. OPTIONS FAILAT 6                            /* ignore warnings         */
  14.  
  15. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  16.  
  17. /* ------------------------- INSERT YOUR CODE HERE: -------------------- */
  18.  
  19. 'QUERY CAT'
  20. isGerman = (result = "deutsch")
  21.  
  22. 'QUERY ANYTEXT'
  23.  
  24. if (result = TRUE) then 
  25.  
  26.     do
  27.         if (isGerman) then
  28.             'REQUEST LONG TITLE="Erste Zeilennummer:" MIN=0 MAX=10000 VAR=FIRST'
  29.         else
  30.             'REQUEST LONG TITLE="Enter 1st number:"   MIN=0 MAX=10000 VAR=FIRST'
  31.  
  32.         if (RC = 0) then do
  33.  
  34.             if (isGerman) then
  35.                 'REQUEST LONG TITLE "Schrittweite:" MIN=1 MAX=1000 OLD=10 VAR=STEP'
  36.             else
  37.                 'REQUEST LONG TITLE "Enter step:"   MIN=1 MAX=1000 OLD=10 VAR=STEP'
  38.  
  39.             if (RC = 0) then do
  40.  
  41.                 'FOLD ALL OPEN=TRUE'
  42.  
  43.                 'QUERY LINES VAR=LINES'
  44.  
  45.                 'SET NAME=INSERT VALUE=TRUE'
  46.  
  47.                 'GOTO LINE=1 COLUMN=1'
  48.  
  49.                 size   = LENGTH(first + lines * step)
  50.                 number = first
  51.  
  52.                 do line = 1 to lines
  53.  
  54.                     'TEXT STAY T="' || right('0000000' || number, size) || ' "'
  55.                     'DOWN'
  56.  
  57.                     number = number + step
  58.                 end
  59.             end
  60.         end
  61.     end
  62.  
  63. else do
  64.  
  65.    if (isGerman) then
  66.        'REQUEST PROBLEM="Kein Text vorhanden ?!"'
  67.     else
  68.        'REQUEST PROBLEM="Text buffer is empty ?!"'
  69. end
  70.  
  71. /* ---------------------------- END OF YOUR CODE ----------------------- */
  72.  
  73. 'UNLOCK' /* VERY important: unlock GUI */
  74.  
  75. exit
  76.  
  77. SYNTAX:
  78.  
  79. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  80.  
  81. 'UNLOCK'
  82.  
  83. exit
  84.